Integrand size = 21, antiderivative size = 231 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \sec (c+d x)}{a-b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a-b) d (1+n)}-\frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \sec (c+d x)}{a+b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a+b) d (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a-b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a-b)^2 d (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a+b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a+b)^2 d (1+n)} \]
[Out]
Time = 0.24 (sec) , antiderivative size = 231, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3959, 186, 70, 726} \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\frac {(a+b \sec (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \sec (c+d x)}{a-b}\right )}{4 d (n+1) (a-b)}-\frac {(a+b \sec (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \sec (c+d x)}{a+b}\right )}{4 d (n+1) (a+b)}+\frac {b (a+b \sec (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (2,n+1,n+2,\frac {a+b \sec (c+d x)}{a-b}\right )}{4 d (n+1) (a-b)^2}+\frac {b (a+b \sec (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (2,n+1,n+2,\frac {a+b \sec (c+d x)}{a+b}\right )}{4 d (n+1) (a+b)^2} \]
[In]
[Out]
Rule 70
Rule 186
Rule 726
Rule 3959
Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {x^2 (a-b x)^n}{(-1+x)^2 (1+x)^2} \, dx,x,-\sec (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (\frac {(a-b x)^n}{4 (-1+x)^2}+\frac {(a-b x)^n}{4 (1+x)^2}+\frac {(a-b x)^n}{2 \left (-1+x^2\right )}\right ) \, dx,x,-\sec (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {(a-b x)^n}{(-1+x)^2} \, dx,x,-\sec (c+d x)\right )}{4 d}-\frac {\text {Subst}\left (\int \frac {(a-b x)^n}{(1+x)^2} \, dx,x,-\sec (c+d x)\right )}{4 d}-\frac {\text {Subst}\left (\int \frac {(a-b x)^n}{-1+x^2} \, dx,x,-\sec (c+d x)\right )}{2 d} \\ & = \frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a-b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a-b)^2 d (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a+b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a+b)^2 d (1+n)}-\frac {\text {Subst}\left (\int \left (-\frac {(a-b x)^n}{2 (1-x)}-\frac {(a-b x)^n}{2 (1+x)}\right ) \, dx,x,-\sec (c+d x)\right )}{2 d} \\ & = \frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a-b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a-b)^2 d (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a+b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a+b)^2 d (1+n)}+\frac {\text {Subst}\left (\int \frac {(a-b x)^n}{1-x} \, dx,x,-\sec (c+d x)\right )}{4 d}+\frac {\text {Subst}\left (\int \frac {(a-b x)^n}{1+x} \, dx,x,-\sec (c+d x)\right )}{4 d} \\ & = \frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \sec (c+d x)}{a-b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a-b) d (1+n)}-\frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \sec (c+d x)}{a+b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a+b) d (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a-b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a-b)^2 d (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {a+b \sec (c+d x)}{a+b}\right ) (a+b \sec (c+d x))^{1+n}}{4 (a+b)^2 d (1+n)} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(1520\) vs. \(2(231)=462\).
Time = 16.83 (sec) , antiderivative size = 1520, normalized size of antiderivative = 6.58 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\frac {(a+b) (b+a \cos (c+d x))^{-n} \left (\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\frac {(-a+b) \cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^n \left (\cos (c+d x) \sec ^4\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^{-n} (a+b \sec (c+d x))^n \left (\frac {1}{1-\tan ^2\left (\frac {1}{2} (c+d x)\right )}\right )^n \left (a+b-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (1-\tan ^4\left (\frac {1}{2} (c+d x)\right )\right )^n \left (b+\frac {a-a \tan ^2\left (\frac {1}{2} (c+d x)\right )}{1+\tan ^2\left (\frac {1}{2} (c+d x)\right )}\right )^n \left (-\frac {\operatorname {Hypergeometric2F1}\left (n,1+n,2+n,\frac {a+b-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{2 b}\right ) \left (2-2 \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{b}\right )^n \left (a+b-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{1+n}}{(a-b) (1+n)}+\frac {\operatorname {Hypergeometric2F1}\left (1,-n,1-n,\frac {(a+b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{a \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-b \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}\right ) \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^n}{n}-\frac {\cot ^2\left (\frac {1}{2} (c+d x)\right ) \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{1-n} \left (a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{1+n}}{a+b}-\frac {2^n \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{2 b}\right ) \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\frac {a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^{-n}}{n}-\frac {\frac {\operatorname {Hypergeometric2F1}\left (n,1+n,2+n,\frac {a+b-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{2 b}\right ) \left (2-2 \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{b}\right )^n \left (a+b-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{1+n}}{1+n}+\frac {(a-b) \operatorname {Hypergeometric2F1}\left (1,-n,1-n,\frac {(a+b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{a \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-b \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}\right ) \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^n}{n}-\frac {2^n (a-b) \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{2 b}\right ) \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\frac {a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^{-n}}{n}-\frac {2 (a+b n) \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{-n} \left (a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\frac {a+b+(-a+b) \tan ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^{-n} \left (-2^n \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{2 b}\right )+\operatorname {Hypergeometric2F1}\left (1,-n,1-n,\frac {(a+b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{a \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-b \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}\right ) \left (\frac {a+b-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^n\right )}{n}}{a+b}\right )}{2 d \left (a \left (\frac {(-a+b) \cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^n+4 b \left (\frac {(-a+b) \cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^n+3 a \left (\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{b}\right )^n+4 a \cos (c+d x) \left (\left (\frac {(-a+b) \cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^n-\left (\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{b}\right )^n\right )-a \cos (2 (c+d x)) \left (\left (\frac {(-a+b) \cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{b}\right )^n-\left (\frac {(a-b) \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{b}\right )^n\right )\right )} \]
[In]
[Out]
\[\int \csc \left (d x +c \right )^{3} \left (a +b \sec \left (d x +c \right )\right )^{n}d x\]
[In]
[Out]
\[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\int { {\left (b \sec \left (d x + c\right ) + a\right )}^{n} \csc \left (d x + c\right )^{3} \,d x } \]
[In]
[Out]
Timed out. \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\int { {\left (b \sec \left (d x + c\right ) + a\right )}^{n} \csc \left (d x + c\right )^{3} \,d x } \]
[In]
[Out]
\[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\int { {\left (b \sec \left (d x + c\right ) + a\right )}^{n} \csc \left (d x + c\right )^{3} \,d x } \]
[In]
[Out]
Timed out. \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^n \, dx=\int \frac {{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^n}{{\sin \left (c+d\,x\right )}^3} \,d x \]
[In]
[Out]